package org.njo.webapp.templates.servlet.wrapper;

import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.ServletOutputStream;

/**
 * ServletOutputStream包装器.
 * 
 * 使用指定的OutputStream的write方法实现ServletOutputStream类的write.
 * 
 * @author yu.peng
 */
class ServletOutputStreamWrapper extends ServletOutputStream {
    private OutputStream output;
    public ServletOutputStreamWrapper(OutputStream output) {
        this.output = output;
    }
    public void write(int b) throws IOException {
        output.write(b);
    }
    public void write(byte b[], int off, int len) throws IOException {
        output.write(b, off, len);
    }
    public void close() throws IOException {
        output.close();
    }
    public void flush() throws IOException {
        output.flush();
    }
}
